package com.tianjishuju.cimiss.station.station.manager;

import com.tianjishuju.cimiss.station.station.util.ObjUtil;

public enum RainGrade {
    Storm("暴风雨"), HaleWater("大雨"), ModerateRain("中雨"), LightRain("小雨");
    private String description;

    private RainGrade() {
    }

    private RainGrade(String description) {
        this.description = description;
    }

    ;

    public String getDescription() {
        return description;
    }

    public static String getRainGrade(Double num) {
        if (ObjUtil.isEmpty(num)) {
            return "";
        }
        if (num.compareTo(16.0) >= 0) {
            return RainGrade.Storm.getDescription();
        } else if (num.compareTo(8.1) >= 0) {
            return RainGrade.HaleWater.getDescription();
        } else if (num.compareTo(2.6) >= 0) {
            return RainGrade.ModerateRain.getDescription();
        } else if (num.compareTo(2.5) <= 0 && num.compareTo(0.0) == 1) {
            return RainGrade.Storm.getDescription();
        }
        return "";
    }

    public static void main(String[] args) {
        System.out.println("   : " + getRainGrade(2.7));
    }
}
